import { defineConfig } from "vite";
import postcssConfig from './postcss.config'
import uni from "@dcloudio/vite-plugin-uni";
import uvtw from '@uni-helper/vite-plugin-uni-tailwind'

// https://vitejs.dev/config/
export default defineConfig({
  css: {
    postcss: postcssConfig,
  },
  plugins: [
    uni(),
    uvtw(),
  ],
    server: {
      proxy: {
        //  外网访问
        '/api': {
          target: 'http://120.92.208.117:18899',
          changeOrigin: true,
          // ws: true,
          rewrite: (path) => path.replace(new RegExp(`^/api`), '/api'),
        },
      },
    },
});
